const app = getApp()
Page({
    data: {
      
    },

  


    onShow: function () {
        this.onLoad();
    },


    onLoad: function () {
        var that = this;
     
        wx.request({
            url: app.globalData.headurl + '/getAllRecommend',
            method: 'get',
            header: {
                'content-type': 'application/x-www-form-urlencoded' // POST请求
            },
            success: function (res) {
                console.log("返回的文章数据:",res)
                that.setData({
                    recommendlist: res.data.data
                })
            },
            fail: function () {

            }
        })
    },

    tourl: function (e) {
        var id = e.currentTarget.dataset.id;
        wx.navigateTo({
            url: "/pages/details/details?id=" + id
        });
    },

  
})